//
//  HWLiBaoCenterCell.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/11/1.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWLiBaoCenterCell.h"

@interface HWLiBaoCenterCell()
@property(strong,nonatomic) UILabel *xingShouLabel;
@property(strong,nonatomic) UILabel *jianjienLabel;
@property(strong,nonatomic) UIButton *receiveBut;


@end


@implementation HWLiBaoCenterCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addControls];
        
    }
    
    return  self;
}

- (void)addControls {
    
    self.xingShouLabel  = [[UILabel alloc]initWithFrame:CGRectMake(24, 9, 60, 18)];
     self.xingShouLabel.text = @"新手礼包";
       self.xingShouLabel.font = [UIFont systemFontOfSize:11];
       self.xingShouLabel.textColor = RGB(30, 127, 255);
    //   self.mingchenglabel.backgroundColor = [UIColor redColor];
    self.xingShouLabel.textAlignment =  NSTextAlignmentCenter;
    self.xingShouLabel.layer.borderWidth = 1;
    self.xingShouLabel.layer.borderColor = RGB(38, 154, 255).CGColor;
    self.xingShouLabel.layer.cornerRadius = 3;
    self.xingShouLabel.layer.masksToBounds = YES;
    [self.contentView addSubview:self.xingShouLabel];
    
    
    self.jianjienLabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.xingShouLabel.right+5, 0,kScreenW-60-24-100 , 36)];
    self.jianjienLabel.text = @"礼包简介：经验加速卡*2";
    self.jianjienLabel.font = [UIFont systemFontOfSize:11];
    self.jianjienLabel.textColor = RGB(130, 130, 130);
    //   self.mingchenglabel.backgroundColor = [UIColor redColor];
    self.jianjienLabel.textAlignment =  NSTextAlignmentLeft;
//    self.jianjienLabel.layer.borderWidth = 1;
//    self.jianjienLabel.layer.borderColor = RGB(38, 154, 255).CGColor;
//    self.jianjienLabel.layer.cornerRadius = 3;
//    self.jianjienLabel.layer.masksToBounds = YES;
    [self.contentView addSubview:self.jianjienLabel];
    
    
     UIButton *topUpbut = [UIButton buttonWithType:UIButtonTypeCustom];
            topUpbut.frame = CGRectMake(kScreenW-50-24, 9, 50,18);
            topUpbut.titleLabel.font = [UIFont systemFontOfSize:12];
           // topUpbut.backgroundColor = RGB(26, 113, 255);
    
    

    [topUpbut setTitle:@"领取" forState:UIControlStateNormal];
    [topUpbut setTitle:[HWjianzhiduiObject keylocalization:@"领取"] forState:UIControlStateNormal];
    
    
    
        [topUpbut setTitleColor:RGB(30, 127, 255) forState:UIControlStateNormal];
    //        but.layer.cornerRadius = 65*CFLScaleValue/2;
    //        but.layer.masksToBounds = YES;
    [topUpbut addTarget:self action:@selector(topUpbut:) forControlEvents:UIControlEventTouchUpInside];
    topUpbut.layer.borderWidth = 1;
    topUpbut.layer.borderColor = RGB(38, 154, 255).CGColor;
    topUpbut.layer.cornerRadius = 9;
    topUpbut.layer.masksToBounds = YES;
    [self.contentView  addSubview:topUpbut];
    
    
    

}

// 点击领取按钮
- (void)topUpbut:(UIButton *)sender {
    
    
    [self.delegate HWLiBaoCenterxuanzhongCell:self];
    
    
    
    
}




- (void)setFriendModel:(HWLiBaoModel *)friendModel{
    _friendModel = friendModel;

    self.xingShouLabel.text = friendModel.cardname;
    self.jianjienLabel.text = friendModel.content;
    
    
    
    
}

 







@end
